package org.william.consumer;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import org.william.api.pojo.User;
import org.william.api.service.IUserService;

@Component
public class Client implements CommandLineRunner {
    @Reference(version = "1.0")
    private IUserService userService;

    @Override
    public void run(String... args) throws Exception {
        User user = userService.selectUserById(2);
        System.out.println(user);
    }
}
